<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
	xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/css/custom.form.css">
<style type="text/css">
.layui-disabled, .layui-disabled:hover {
    color: #000000!important;
    cursor: not-allowed!important;
}

.layui-form-label {
	width: 100px;
}

.layui-input-block {
	margin-left: 130px;
}

.layui-input layui-unselect {
	cursor: pointer;
}

.layui-table {
	width: 96%;
}
</style>
</head>
<body>
	<div class="panel panel-default operation" hidden>
		<div class="panel-heading title"></div>
		<div class="layui-tab">
			<ul class="layui-tab-title">
				<li class="layui-this">办理</li>
				<li>流程</li>
			</ul>
			
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<div class="layui-card-body">
						<form class="layui-form" action="" lay-filter="info">
							<input name="_tabKey" id="_tabKey" hidden>
							<input name="_jcajxxuuid" id="_jcajxxuuid" hidden>
							
							<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
								<legend>案件信息</legend>
							</fieldset>
				
							<div class="layui-form-item">
								<label class="layui-form-label">案件名称</label>
								<div class="layui-input-inline">
									<input type="text" id="ajmc" name="ajmc"
										class="layui-input layui-disabled" disabled="ture">
								</div>
								
								<label class="layui-form-label">检查项目</label>
								<div class="layui-input-inline">
									<input type="text" id="jcxm" name="jcxm"
										class="layui-input layui-disabled" disabled="ture">
								</div>
							</div>
							<div class="layui-form-item">	
								<label class="layui-form-label">检查人</label>
								<div class="layui-input-inline">
									<input type="text" id="jcry" name="jcry"
										class="layui-input layui-disabled" disabled="ture">
								</div>
							</div>
							<div class="layui-form-item">	
								<label class="layui-form-label">纳税人名称</label>
								<div class="layui-input-inline">
									<input type="text" id="nsrmc" name="nsrmc"
										class="layui-input layui-disabled" disabled="ture">
								</div>
								<label class="layui-form-label">纳税人识别号</label>
								<div class="layui-input-inline">
									<input type="text" id="nsrsbh" name="nsrsbh"
										class="layui-input layui-disabled" disabled="ture">
								</div>
							</div>
							
							<fieldset id="more" class="layui-elem-field layui-field-title" style="margin-top: 10px;">
								<legend style="cursor:pointer;">更多</legend>
							</fieldset>
							
							<div id="moreContent">
								<div class="layui-form-item">
									<label class="layui-form-label">处理完毕标志</label>
									<div class="layui-input-inline">
										<input type="text" id="clwbbz" name="clwbbz"
											class="layui-input layui-disabled" disabled="ture">
									</div>
									
									<label class="layui-form-label">督办案件标志</label>
									<div class="layui-input-inline">
										<input type="text" id="dyabz" name="dyabz"
											class="layui-input layui-disabled" disabled="ture">
									</div>
								</div>
								<div class="layui-form-item">	
									<label class="layui-form-label">稽查案件编号</label>
									<div class="layui-input-inline">
										<input type="text" id="jcajbh" name="jcajbh"
											class="layui-input layui-disabled" disabled="ture">
									</div>
									<label class="layui-form-label">立案日期</label>
									<div class="layui-input-inline">
										<input type="text" id="larq" name="larq"
											class="layui-input layui-disabled" disabled="ture">
									</div>
								</div>
								
								<div class="layui-form-item">	
									<label class="layui-form-label">稽查登记日期</label>
									<div class="layui-input-inline">
										<input type="text" id="jcdjrq" name="jcdjrq"
											class="layui-input layui-disabled" disabled="ture">
									</div>
									<label class="layui-form-label">稽查截至日期</label>
									<div class="layui-input-inline">
										<input type="text" id="jcjzrq" name="jcjzrq"
											class="layui-input layui-disabled" disabled="ture">
									</div>
								</div>
								
								
								<div class="layui-form-item">	
									<label class="layui-form-label">检查时间起</label>
									<div class="layui-input-inline">
										<input type="text" id="jcssqjq" name="jcssqjq"
											class="layui-input layui-disabled" disabled="ture">
									</div>
									<label class="layui-form-label">检查时间止</label>
									<div class="layui-input-inline">
										<input type="text" id="jcssqjz" name="jcssqjz"
											class="layui-input layui-disabled" disabled="ture">
									</div>
								</div>
							</div>
							
							<fieldset id="moreHide" class="layui-elem-field layui-field-title" style="margin-top: 10px;">
								<legend style="cursor:pointer;">隐藏更多</legend>
							</fieldset>
							 
							 
							 
							<fieldset class="layui-elem-field layui-field-title" id="bottomLine"
								style="margin-top: 10px;"></fieldset>
							<div class="layui-form-item">
								<div class="layui-input-block">
									<button type="submit" class="layui-btn" id="pushInspectionMan12"
										onclick="return false" lay-submit lay-filter="pushInspectionMan12">推送检查科主管局长</button>
									
									<button type="submit" class="layui-btn" id="backInspectionMan11"
										onclick="return false" lay-submit lay-filter="backInspectionMan11">退回检查人</button>
											
									<!-- <button type="submit" class="layui-btn" id="scfj"
										onclick="return false" lay-submit lay-filter="scfj">上传附件</button> -->
										
									<button class="layui-btn layui-btn-primary" id="btn_cancel">返回</button>
								</div>
							</div>
						</form>
					</div>
				</div>
				
				<div class="layui-tab-item">
	    			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
						<legend>办理流程</legend>
					</fieldset>
					<div id="activityRecordDiv"></div>
	    		</div>
			</div>
		</div>
	</div>

	<div class="layui-tab table_div">
		<ul class="layui-tab-title">
			<li class="layui-this" id="grdb" >个人待办</li>
			<li id="gryb" >个人已办</li>
		</ul>

		<div class="layui-tab-content">

			<div class="layui-tab-item layui-show">
				<div id="searchParam" >
					<div class="layui-form-item">
						
						<!-- <div class="layui-input-inline layui-form">
							<select id="gwdbSelect">
									<option value="">请选择逾期情况</option>
									<option value="1">一小时后将逾期</option>
									<option value="0">已逾期</option>
							</select>
						</div>
						
						<div class="layui-input-inline ">
							<button class="layui-btn" onclick="gwdbSearch()" id="gwdbSearch">岗位待办查询</button>
						</div> -->
					</div>
					<table class="layui-table" id="grdbShowTable" lay-filter="grdbShowTable"></table>
				</div>
			</div>

			<div class="layui-tab-item">
				<div id="searchParam" >
					<div class="layui-form-item">
						<!-- <div class="layui-input-inline">
							<input type="text" id="grdbInput" class="layui-input"
								autocomplete="off" placeholder="请输入投诉编号">
						</div>
						
						<div class="layui-input-inline layui-form">
							<select id="grdbSelect">
									<option value="">请选择逾期情况</option>
									<option value="1">一小时后将逾期</option>
									<option value="0">已逾期</option>
							</select>
						</div> 
						
						<div class="layui-input-inline ">
							<button class="layui-btn" onclick="grdbSearch()" id="grdbSearch">个人待办查询</button>
						</div>
						-->
					</div>
					<table class="layui-table" id="grybShowTable" lay-filter="grybShowTable"></table>
				</div>
			</div>
			
		</div>
	</div>
	
	<div id="pushInspectionMan12Div" class="demo-transfer" style="display: none">
		<div class="layui-form" action="">
			<div class="layui-form-item" style="margin-top: 5px">
				<label class="layui-form-label" style="">填写内容</label>
				<div class="layui-input-block">
					<textarea rows="2" name="inspectionContent" id="inspectionContent"
						placeholder="请输入推送原因填写补充,1-500个字符" autocomplete="off"
						class="layui-textarea"
						onkeyup="javascript:texLength2(this, 'textarea_length2');"></textarea>
					<span class="red" id="textarea_length2">0</span> / <span
						class="num_count1">500</span>
				</div>
			</div>
		
			<div class="layui-form-item" style="margin-top: 5px">
				<label class="layui-form-label" style="">选择人员</label>
				<div class="layui-input-block">
	      			<select lay-search="" name="inspectionMan" lay-filter="inspectionMan" id="inspectionMan">
				        <option value="">请选择人员</option>
	      			</select>
				</div>
			</div>
		</div>
	</div>
		
	<div id="viewBackDiv" class="demo-transfer" style="display: none">
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label">退回原因</label>
			<div class="layui-input-block">
				<textarea rows="4" name="viewBackTextarea" id="viewBackTextarea" 
					class="layui-textarea layui-disabled" disabled="ture"></textarea>
			</div>
		</div>
	</div>
	
	<div id="backInspectionMan11Div" class="demo-transfer" style="display: none">
		<div class="layui-form" action="">
			<div class="layui-form-item" style="margin-top: 5px">
				<label class="layui-form-label" style="">填写内容</label>
				<div class="layui-input-block">
					<textarea rows="2" name="backContent" id="backContent"
						placeholder="请输入退回原因,1-500个字符" autocomplete="off"
						class="layui-textarea"
						onkeyup="javascript:texLength2(this, 'textarea_length2');"></textarea>
					<span class="red" id="textarea_length2">0</span> / <span
						class="num_count1">500</span>
				</div>
			</div>
		</div>
	</div>
	
	
	<script type="text/html" id="grdbTool">
		<a class="layui-btn layui-btn-xs" lay-event="view">办理</a>
	</script>

	<script type="text/html" id="grybTool">
		<a class="layui-btn layui-btn-xs" lay-event="view">查看</a>
	</script>

<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script>
	// 获取token
	var token = CoreUtil.getData("access_token");
	// 地址栏转义token中的#号
	var tokenQuery = token.replace("#", "%23");

	var grdbTableIns;
	var grybTableIns;
	
	var table = layui.table;
	var form = layui.form;
	var layer = layui.layer;
	var $ = jQuery = layui.jquery;
	var laydate = layui.laydate;
	var upload = layui.upload;
	var element = layui.element;
	var maxlength = 500;
	var inspectionMan = "";
	
	
	var syslog = {
			'operation' : "hearPage25",
		};
		CoreUtil.sendPost("/sys/addLogs", syslog, function(res) {
			
		});
		
	
	layui.use([ 'table', 'layer', 'laydate', 'upload', 'element' ], function() {
		// 个人待办
		grdbTableIns = table.render({
			elem : '#grdbShowTable',
			contentType : 'application/json',
			headers : {
				"authorization" : token
			},
			page : true // 开启分页
			,
			url : '/workflow/inspect/listwait12' //数据接口
			,
			method : 'POST',
			parseData : function(res) { //将原始数据解析成 table 组件所规定的数据
				return {
					"code" : res.code, //解析接口状态
					"msg" : res.msg, //解析提示文本
					"count" : CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
					"data" : CoreUtil.isEmpty(res.data) ? null
							: CoreUtil.paramsDecrypt(res.data.records)
				}
			},
			cols : [ [
			          {
			        	  align : 'center',
			        	  width : 230,
			        	  field : 'jcajxxuuid',
			        	  title : '检查UUID',
			        	  sort : true,
			        	  hide : true
			          }, {
							align : 'center',
							width : 158,
							field : 'jcajbh',
							title : '检查案件编号',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'ajmc',
							title : '案件名称',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'stateCode',
							title : '系统状态代码',
							sort : true,
							hide : true
						},{
							align : 'center',
							width : 158,
							field : 'stateName',
							title : '系统状态',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'jcry',
							title : '检查人员',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'jcxm',
							title : '检查项目',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'nsrmc',
							title : '纳税人名称',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'nsrsbh',
							title : '纳税人识别号',
							sort : true,
						},{
							fixed : 'right',
							align : 'center',
							width : 75,
							toolbar : "#grdbTool",
							title : '操作'
						}

			          ] ],
			toolbar : '#grdbToolbar'
		});

		// 个人已办
		grybTableIns = table.render({
			elem : '#grybShowTable',
			contentType : 'application/json',
			headers : {
				"authorization" : token
			},
			page : true // 开启分页
			,
			url : '/workflow/inspect/listthen12' //数据接口
			,
			method : 'POST',
			parseData : function(res) { //将原始数据解析成 table 组件所规定的数据
				return {
					"code" : res.code, //解析接口状态
					"msg" : res.msg, //解析提示文本
					"count" : CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
					"data" : CoreUtil.isEmpty(res.data) ? null
							: CoreUtil.paramsDecrypt(res.data.records)
				}
			},
			cols : [ [
			          {
			        	  align : 'center',
			        	  width : 230,
			        	  field : 'jcajxxuuid',
			        	  title : '检查UUID',
			        	  sort : true,
			        	  hide : true
			          }, {
							align : 'center',
							width : 158,
							field : 'jcajbh',
							title : '检查案件编号',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'ajmc',
							title : '案件名称',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'stateCode',
							title : '系统状态代码',
							sort : true,
							hide : true
						},{
							align : 'center',
							width : 158,
							field : 'stateName',
							title : '系统状态',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'jcry',
							title : '检查人员',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'jcxm',
							title : '检查项目',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'nsrmc',
							title : '纳税人名称',
							sort : true,
						},{
							align : 'center',
							width : 158,
							field : 'nsrsbh',
							title : '纳税人识别号',
							sort : true,
						},{
							fixed : 'right',
							align : 'center',
							width : 75,
							toolbar : "#grybTool",
							title : '操作'
						}
			          ] ],
			toolbar : '#grybToolbar'
		});

		// 个人待办表头工具
		table.on('grdbToolbar(grdbShowTable)', function(obj) {
			switch (obj.event) {
			}
			;
		});

		// 个人已办表头工具
		table.on('grybToolbar(grybShowTable)', function(obj) {
			switch (obj.event) {
			}
			;
		});

		// 列操作
		table.on('tool(grdbShowTable)', function(obj) {
			var data = obj.data;
			switch (obj.event) {
			case 'view':
				/* lock(data); */
				view(data, "0");
				break;
			}
		});

		// 个人已办操作
		table.on('tool(grybShowTable)', function(obj) {
			var data = obj.data;
			switch (obj.event) {
			case 'view':
				view(data, "1");
				break;
			}
		});

		// 返回
		$("#btn_cancel").click(function() {
			back();
			return false;
		});
		
		// 推送业务部门税务机关
		form.on('select(inspectionMan)', function(){
			var myselect=document.getElementById("inspectionMan");
			var index=myselect.selectedIndex ; // selectedIndex代表的是你所选中项的index
			inspectionMan = myselect.options[index].value;
		
		});
		
		// 退回检查人
		form.on('submit(backInspectionMan11)', function(data) {
			layer.open({
				type : 1,
				offset : '50px',
				skin : 'layui-layer-molv',
				title : "退回检查人",
				area : [ '700px', '320px' ],
				shade : 0,
				shadeClose : false,
				content : jQuery("#backInspectionMan11Div"),
				btn : [ '退回检查人', '取消' ],
				yes : function(index) {
					var jcajxxuuid = $('#_jcajxxuuid').val();
					var mapArr = {
						'jcajxxuuid' : jcajxxuuid,
						'backContent' : $('#backContent').val(),
					};

					CoreUtil.sendPost("/workflow/activity/back", mapArr,
						function(res) {
							if (res.code == '0') {
								layer.msg("成功 退回检查人！");
								back();
								return false;
							} else {
								layer.msg(res.msg);
								return false;
							}
						});
					layer.close(index);
				}
			});
			
		});
		
		// 推送人员机关
		form.on('submit(pushInspectionMan12)', function(data) {
			inspectionMan = "";
			var mapArr = {
				'id' : "1708113753208807426",
			};
			
			CoreUtil.sendPost("/workflow/activity/postman", mapArr, function(res) {
				if (res.code == '0') {
					var value = res.data;
					var opt = "<option value = ''>请选择推送人员</option>";
					for (var i in value) {
                        opt += '<option value = "' + value[i].swryDm + '">' + value[i].rysfmc + '</option>';
                    }
                    $("#inspectionMan").html(opt);
                    form.render('select'); //需要渲染一下
				} else {
					layer.msg(res.msg);
					return false;
				}
			});
			
			layer.open({
				type : 1,
				offset : '50px',
				skin : 'layui-layer-molv',
				title : "推送检查科主管局长",
				area : [ '700px', '420px' ],
				shade : 0,
				shadeClose : false,
				content : jQuery("#pushInspectionMan12Div"),
				btn : [ '推送检查科主管局长', '取消' ],
				yes : function(index) {
					var jcajxxuuid = $('#_jcajxxuuid').val();
					
					var mapArr = {
						'jcajxxuuid' : jcajxxuuid,
						'inspectionMan' : inspectionMan,
						'inspectionContent' : $('#inspectionContent').val(),
					};

					CoreUtil.sendPost("/workflow/activity/push", mapArr,
						function(res) {
							if (res.code == '0') {
								layer.msg("成功 推送检查科主管局长！");
								back();
								return false;
							} else {
								layer.msg(res.msg);
								return false;
							}
						});
					layer.close(index);
				}
			});

		});
		
		
		// 查看退回原因
		form.on('submit(viewBack)', function(data) {
			var sjbh = $('#_sjbh').val();
			var clzt = data.field._clzt;
			if (CoreUtil.isEmpty(sjbh)) {
				layer.msg("sjbh没有获取到，请稍后重试!");
				return false;
			}
			if (CoreUtil.isEmpty(clzt)) {
				layer.msg("clzt没有获取到，请稍后重试!");
				return false;
			}
			
			viewBack(sjbh,clzt);
			
			layer.open({
				type : 1,
				offset : '50px',
				skin : 'layui-layer-molv',
				title : "查看退回原因",
				area : [ '500px', '400px' ],
				shade : 0,
				shadeClose : false,
				content : jQuery("#ckthyyDiv"),
				btn : [ '确定', '取消' ],
				yes : function(index) {
					layer.close(index);
				}
			});
			
		});
		

		$("#grdb").click(function() {
			grdbSearch();
		});

		$("#gryb").click(function() {
			grybSearch();
		});
		
		$("#more").click(function() {
			$("#more").hide();
			$("#moreContent").show();
			$("#moreHide").show();
		});
		
		$("#moreHide").click(function() {
			$("#more").show();
			$("#moreContent").hide();
			$("#moreHide").hide();
		});
		
		upload.render({
		      elem: '#scfj' //绑定元素
		      ,url: '/fwdSjfjlb/add?authorization='+tokenQuery //上传接口
		      ,exts: 'jpg|jpeg|png|mp3|wave|wmv|asf|rmvb|mp4|3gp|mov|m4v|pdf|' //限制上传文件
      			  ,size:"20480"
	    	  ,before: function(obj){
					this.data = {
						sjbh: $("#_sjbh").val(),						
					}
			   }
		      ,done: function(res){
		    	  if(res.code == "0"){
		    		  layer.msg("文件上传成功！");
			    	  var _sjbh = $("#_sjbh").val();
			    	  fwdSjfjlbView(_sjbh,"Y");
		    	  }else{
		    		  layer.msg(res.msg);
		    	  }
		    	  
		      }
		      ,error: function(){
		    	  layer.msg("文件上传失败，请稍后重试！");
		      }
		  });

	});

	// 执行查询
	function gwdbSearch() {
		var gwdbInput = $("#gwdbInput").val();
		var _gwdbSelect = $("#gwdbSelect").val();

		grdbTableIns.reload({
			where : {
				sjbh : gwdbInput,
				yqzt : _gwdbSelect,
			},
			
			page : {
				curr : 1
			}
		});
	};

	

	// 个人已办执行查询
	function grybSearch() {
		var grybInput = $("#grybInput").val();
		grybTableIns.reload({
			where : {
				sjbh : grybInput,
			},
			page : {
				curr : 1
			}
		});
	};

	function downloadFile(e) {
		$(e).attr('src');
		window.open($(e).attr('src'), '_blank');
	}

	function lock(data) {
		var mapArr = {
			jcajxxuuid : data.jcajxxuuid
		};

		CoreUtil.sendPost("/workflow/activity/lock", mapArr, function(res) {
			if (res.code == '0') {
				layer.msg("受理成功，进入受理页面");
			} else {
				layer.msg(res.msg);
				return false;
			}
		});

	}

	function view(data, type) {
		$("#_tabKey").val(type);
		$("#_jcajxxuuid").val(data.jcajxxuuid);
		
		$(".title").html("案件编号：" + data.jcajbh);
		$("#ajmc").val(data.ajmc);
		$("#jcxm").val(data.jcxm);
		$("#nsrmc").val(data.nsrmc);
		$("#nsrsbh").val(data.nsrsbh);
		$("#jcry").val(data.jcry);
		
		$("#clwbbz").val(data.clwbbz);
		$("#dyabz").val(data.dyabz);
		$("#jcajbh").val(data.jcajbh);
		$("#larq").val(data.larq);
		$("#jcdjrq").val(data.jcdjrq);
		$("#jcjzrq").val(data.jcjzrq);
		$("#jcssqjq").val(data.jcssqjq);
		$("#jcssqjz").val(data.jcssqjz);
		
		$("#more").show();
		$("#moreContent").hide();
		$("#moreHide").hide();
		
		
		var _fjdz = data.fjdz;
		if (!CoreUtil.isEmpty(_fjdz)) {
			$("#fjdz").val(_fjdz);
			var fjdzArr = _fjdz.split(",");
			var tmp = "<table class='layui-table'><tbody>";
			for (var i = 0;i<fjdzArr.length;i++) {
				var _fjdz = '"' + fjdzArr[i] + '"';
				var _i = i + 1;
				tmp += "<tr><td>附件" + _i + "</td><td>"
						+ "<a class='layui-btn layui-btn-xs' onclick='yjyl("
						+ _fjdz + ")'>一键预览</a>"
						+ "<a class='layui-btn layui-btn-xs' onclick='yjfz("
						+ _fjdz + ")'>一键复制</a>" + "</td></tr>";
			}
			tmp += "</tbody></table>";
			$("#fjdzDiv").html(tmp);
		} else {
			$("#fjdzDiv").html("未传附件");
		};
		// 查询办理流程
		activityRecordDiv(data.jcajxxuuid);
		
		if(type == "0"){
			$("#pushInspectionMan12").show();
			$("#backInspectionMan11").show();
			
		}else if(type == "1"){
			$("#pushInspectionMan12").hide();
			$("#backInspectionMan11").hide();
			
		}
		
		$(".table_div").hide();
		$(".operation").show();
	};

	function fwdSjfjlbView(_sjbh,flag){
			
			// 获取 上传的附件列表
			var mapArr = {
				'sjbh' : _sjbh,
			};
			
			CoreUtil.sendPost("/fwdSjfjlb/view", mapArr, function(res) {
				if(res.code == "0"){
					var data = res.data;
					if (!CoreUtil.isEmpty(data)) {
						var tmp = "<table class='layui-table'><tbody>";
						for (var i = 0;i<data.length;i++) {
							var _fjdz = '"' + data[i].url + '"';
							var _createId = '"' + data[i].createId + '"';
							var _id = '"' + data[i].id + '"';
							var _sjbh = '"' + data[i].sjbh + '"';
							var tmpDel = "";
							if(flag == "Y"){
								tmpDel = "<a class='layui-btn layui-btn-xs fjDeleteId' onclick='deletefj(" + _id + ","+_createId+","+_sjbh+")'>删除</a>"
							}
							
							tmp += "<tr>"
								+ "<td>" + data[i].fileName + "</td>"
								+ "<td>上传时间：" + data[i].createDate  + "</td>"
								+ "<td>上传人：" + data[i].createIdName  + "</td>"
								+ "<td>"
								+ "<a class='layui-btn layui-btn-xs' onclick='yjyl(" + _fjdz + ")'>一键预览</a>"
								+ "<a class='layui-btn layui-btn-xs' onclick='yjfz(" + _fjdz + ")'>一键复制</a>"
								+ tmpDel
								+ "</td></tr>";
						}
						tmp += "</tbody></table>";
						$("#fjdzDiv1").html(tmp);
					} else {
						$("#fjdzDiv1").html("暂无附件");
					}
				}
			});
			
	}
	
	function texLength1(obj, id) {
		var curr = obj.value.length;
		if (curr > maxlength) {
			layer.msg('反馈内容字数在' + maxlength + '字以内');
		} else {
			document.getElementById(id).innerHTML = curr;
		}
	}

	function texLength2(obj, id) {
		var curr = obj.value.length;
		if (curr > maxlength) {
			layer.msg('推送原因字数在' + maxlength + '字以内');
		} else {
			document.getElementById(id).innerHTML = curr;
		}
	}

	function yjfz(_url) {
		var Url2 = _url;
		var oInput = document.createElement('input');
		oInput.value = Url2;
		document.body.appendChild(oInput);
		oInput.select(); // 选择对象
		document.execCommand("Copy"); // 执行浏览器复制命令
		oInput.className = 'oInput';
		oInput.style.display = 'none';
		layer.msg('已复制成功！');
	}

	function yjyl(_url) {
		window.open(_url, '_blank');
	}
	
	function deletefj(_id ,_createId,_sjbh){
		// 删除附件
		var mapArr = {
			'id' : _id,
			'sjbh' : _sjbh,
			'createId' : _createId,
			'flag' : "Y",
		};
			
		CoreUtil.sendPost("/fwdSjfjlb/delete", mapArr, function(res) {
			if (res.code == '0') {
				layer.msg("文件删除成功！");
				fwdSjfjlbView(_sjbh,"Y");
			} else {
				layer.msg("文件删除失败，请稍后重试！");
				return false;
			}
		});
	}
	
	function back() {
		var _tabKey = $("#_tabKey").val();
		if (_tabKey == "0") {
			gwdbSearch();
			$("#grdb").attr("class", "layui-this");
			$("#gryb").attr("class", "");

		} else if (_tabKey == "1") {
			grdbSearch();
			$("#grdb").attr("class", "");
			$("#gryb").attr("class", "layui-this");
			
		} else {

		}
		
		$(".table_div").show();
		$(".operation").hide();
	}
	
	
	function ckthyy(sjbh,clzt){
		// 获取意见
		var mapArr = {
			'sjbh' : sjbh,
			'sjzt' : clzt,
		};
		
		CoreUtil.sendPost("/sjhd/thyy", mapArr, function(res) {
			if (res.code == '0') {
				$("#ckthyyTextarea").val(res.data.hdnr);
			} else {
				layer.msg("没有获取到推送原因！");
				return false;
			}
		});
	};
	
	function activityRecordDiv(jcajxxuuid){
		$("#activityRecordDiv").html("");
		var mapArr = {
			relevance : jcajxxuuid
		};
		
		CoreUtil.sendPost("/workflow/activity/record", mapArr, function(res) {
			if (res.code == '0') {
				var data = res.data;
				if (!CoreUtil.isEmpty(data)) {
					
					var tmp = "<table class='layui-table'><tbody><tr>"
							+ "<td>序号</td>"
							+ "<td>处理时间</td>"
							+ "<td>状态</td>"
							+ "<td>处理人</td>"
							+ "<td>内容</td>"
							+ "<td>备注</td>"

					for (var i in data) {
						var content = "暂无";
						if(!CoreUtil.isEmpty(data[i].content)){
							content = data[i].content;
						}
						
						tmp += "<tr><td>" + i + "</td>"
								+ "<td>" + data[i].createTime + "</td>"
								+ "<td>" + data[i].stateName + "</td>"
								+ "<td>" + data[i].currentMan + "</td>"
								+ "<td>" + content + "</td>"
								+ "<td>" + data[i].remark + "</td>"

					}
					tmp += "</tbody></table>";
					$("#activityRecordDiv").html(tmp);
				} else {
					$("#activityRecordDiv").html("暂无流程");
				}
				
			} else {
				// layer.msg(res.msg);
				return false;
			}
		});
		
	};
	
	
</script>

</body>
</html>